<?php

$config = require_once 'config.php';
$linkUrls = json_decode($config['linkUrls']);
// echo $config['linkUrl'];
?>

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
	<title>config设置</title>
	<link rel="stylesheet" id="templatecss" type="text/css" href="../css/basic-grey.css">
	<link rel="stylesheet"  type="text/css" href="../css/img.css">
	<script type="text/javascript" src="../js/jquery.js"></script>
</head>
<body>

	<form action="" method="post" class="basic-grey" id="config_form">
		<center><h1>config设置
			<span>config Settings.</span>
		</h1></center>
		<center style="margin-bottom:25px;"><span class="button share_list" style="border: 1px solid #000000;padding: 5px 5px 5px 5px;">分享链接列表</span> </center>
		<p></p>
		<p></p>
		<label>	
				
			<span>落地页更换设置 :</span>
			<select id="linkUrl" name="linkUrl" >
			<?php foreach($linkUrls as $value): ?>
				<option value="<?php echo $value ?>" <?php if ($config['linkUrl'] == $value){echo 'selected';}  ?> ><?php echo $value ?></option>
			<?php endforeach ?>	
			</select>
		</label>
		<!-- <label>
			<span>分享标题 :</span>
			<textarea id="title" type="text" name="title" placeholder="分享标题" /></textarea>
		</label>
		<label>
			<span>分享图片 :</span>
			<img class="img" style="width:80px;height:80px;" src="">
			<input type="button" class="button checkimg" value="选择图片" />
		</label>

		<label>
			<span>分享描述 :</span>
			<textarea id="desc" name="desc" placeholder="分享内容概要"></textarea>
		</label> -->
		<label>
			<span>&nbsp;</span>
			<input type="button" class="button share_btn" value="提交" />
		</label>
	</form>


	
<script type="text/javascript">

	//选择图片从服务器获取图片
	$('.button').click(function(){
		var url = $("#linkUrl").val();
		$.ajax({
			url:'../control.php?act=configset',
			type: 'POST', //传递方法
			data: {linkUrl:url}, //传递的数据
			dataType : 'json', //传递数据的格式
			success:function(data){ 
				alert(data.msg);
			}
		})
	});
	

	$('.share_list').click(function(){
		window.location.href = "../sharelist.php";
	});

	


</script>
</body>
</html>